
<style lang="scss" scoped>
.entrusthistory {
  float: left;
  width: 100%;
}
.header {
  text-align: center;
  position: relative;
  padding: 10px;
  font-size: 18px;
}
.page {
  text-align: right;
  margin-top: 20px;
}
.table {
  border-radius: 4px;
}
.table .ivu-table-wrapper {
  position: relative;
  /* border: 1px solid #dddee1; */
  border-bottom: 0;
  border-right: 0;
  // box-shadow: 0 0 2px #ccc;
  border-radius: 4px;
  // overflow: hidden;
}
.form.ivu-form-inline .ivu-form-item {
  display: inline-block;
}
</style>
<style lang="scss">
.entrusthistory .ivu-table th,
.entrusthistory .ivu-table td {
  text-align: center;
}
.table .ivu-table-cell-expand {
  color: #f0a70a;
}
</style>

<template>
  <div class="entrusthistory">
    <div class="header">
      <span>出金记录</span>
      <Icon type="ios-arrow-back" size="18" style="position: absolute;left: 10px;" @click="back" />
    </div>
    <div class="table">
      <Table :no-data-text="$t('common.nodata')" :columns="columns" :data="orders" :loading="loading"></Table>
      <div class="page">
        <!--        <Page :total="total" :pageSize="pageSize" :current="pageNo" @on-change="loadDataPage"></Page>-->
      </div>
    </div>
  </div>
</template>
<script>
var moment = require("moment");
import expandRow from "@components/exchange/expand.vue";
export default {
  components: { expandRow },
  data() {
    const self = this;
    return {
      urlList: [],
      preview: false,
      loading: false,
      pageSize: 10,
      pageNo: 1,
      total: 10,
      symbol: [],
      formItem: {
        symbol: "",
        type: "",
        direction: "",
        date: ""
      },
      columns: [
        {
          title: "银行名称",
          key: "bankname",
          render(h, params) {
            return h(
                "span",
                {
                  attrs: {
                    title: params.row.bankname
                  }
                },
                params.row.bankname
            );
          }
        },
        {
          title: "姓名",
          key: "name",
          render(h, params) {
            return h(
                "span",
                {
                  attrs: {
                    title: params.row.name
                  }
                },
                params.row.name
            );
          }
        },
        {
          title: "银行卡号",
          key: "account",
          render(h, params) {
            return h(
                "span",
                {
                  attrs: {
                    title: params.row.account
                  }
                },
                params.row.account
            );
          }
        },
        {
          title: self.$t("uc.finance.trade.turnover"),
          key: "turnover",
          render(h, params) {
            return h(
                "span",
                {
                  attrs: {
                    title: params.row.m
                  }
                },
                params.row.m
            );
          }
        }
      ],
      orders: []
    };
  },
  computed:{
    lang: function() {
      return this.$store.state.lang;
    }
  },
  watch: {
    lang: function() {
      this.updateLangData();
    }
  },
  created() {
    this.getHistoryOrder();
  },
  methods: {
    back() {
      this.$router.back()
    },
    dateFormat: function(tick) {
      return moment(tick).format("YYYY-MM-DD HH:mm:ss");
    },
    getHistoryOrder() {
      //查询历史委托
      this.loading = true;
      var that = this;
      this.orders = [];
      this.$http
          .get( "/api/getExpenditure?token="+sessionStorage.getItem('token'))
          .then(response => {
            var resp = response.body;
            console.log(resp)
            this.orders = resp.data
            this.loading = false;
          });
    }
  }
};
</script>

